/*
ID: zhangmu5
LANG: C++
TASK: friday
*/
#include <bits/stdc++.h>
using namespace std;

int n;
int cnt[8];

int date(int y, int m)
{
    int month[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
    int days = (y - 1900) * 365 + month[m - 1] + 12 + (y - 1900) / 4;

    days -= (y - 1900) / 100;
    days += (y - 1600) / 400;

    if (m <= 2 && (y % 4 == 0 && y % 100 != 0 || y % 400 == 0))
    {
        days--;
    }

    return days % 7 + 1;
}

signed main()
{
    freopen("friday.in", "r", stdin);
    freopen("friday.out", "w", stdout);
    cin >> n;
    for (int y = 1900; y < 1900 + n; y++)
        for (int m = 1; m <= 12; m++)
            cnt[date(y, m)]++;
    cout << cnt[6] << " " << cnt[7] << " " << cnt[1] << " " << cnt[2] << " " << cnt[3] << " " << cnt[4] << " " << cnt[5] << endl;
    return 0;
}